//
//  UIColor+HLJColor.m
//  JiaolianClient
//
//  Created by hlj on 15/8/25.
//  Copyright (c) 2015年 NaoDong. All rights reserved.
//

#import "UIColor+HLJColor.h"
@implementation UIColor (HLJColor)
+ (UIColor *) colorFromHexString:(NSString *)hexString {
    NSString *cleanString = [hexString stringByReplacingOccurrencesOfString:@"#" withString:@""];
    if ([cleanString length] == 3) {
        cleanString = [NSString stringWithFormat:@"%@%@%@%@%@%@",
                       [cleanString substringWithRange:NSMakeRange(0, 1)],[cleanString substringWithRange:NSMakeRange(0, 1)],
                       [cleanString substringWithRange:NSMakeRange(1, 1)],[cleanString substringWithRange:NSMakeRange(1, 1)],
                       [cleanString substringWithRange:NSMakeRange(2, 1)],[cleanString substringWithRange:NSMakeRange(2, 1)]];
    }
    if([cleanString length] == 6) {
        cleanString = [cleanString stringByAppendingString:@"ff"];
    }
    
    unsigned int baseValue;
    [[NSScanner scannerWithString:cleanString] scanHexInt:&baseValue];
    
    float red = ((baseValue >> 24) & 0xFF)/255.0f;
    float green = ((baseValue >> 16) & 0xFF)/255.0f;
    float blue = ((baseValue >> 8) & 0xFF)/255.0f;
    float alpha = ((baseValue >> 0) & 0xFF)/255.0f;
    
    return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
}

///荧光绿
+(UIColor *)fluorescentGreenColor
{
    return [UIColor colorFromHexString:@"#77ff00"];
}

///群绿色
+(UIColor *)ultramarineColor
{
    return [UIColor colorFromHexString:@"2f7ba1"];
}

///墨黑色
+(UIColor *)inkGrayColor
{
    return [UIColor colorFromHexString:@"4f5b6b"];
}

/// darkBlueColor | 黛蓝
+(UIColor *)darkBlueColor
{
    return [UIColor colorFromHexString:@"2d343d"];
}
///crowBlueColor |鸦青
+(UIColor *)crowBlueColor
{
    return [UIColor colorFromHexString:@"151c26"];

}
///dullBlackColor|漆黑
+(UIColor *)dullBlackColor
{
    return [UIColor colorFromHexString:@"091019"];
}

// rockBlackCOlor| 岩黑
+(UIColor *)rockBlackCOlor
{
    return [UIColor colorFromHexString:@"070e17"];
}

+(UIColor *)navColor
{
    return WhiteColor;
}

@end
